<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template name="url_replace_param">
		<xsl:param name="param_name"/>
		<xsl:param name="param_value"/>
		<xsl:param name="delete_params_with_prefix" select="''"/>
		<xsl:value-of select="$prefix"/>
		<xsl:value-of select="$request/@folders"/>
		<xsl:value-of select="'/?'"/>
		<xsl:for-each select="$gparams[@name != $param_name and ($delete_params_with_prefix = '' or substring(@name, 1, string-length($delete_params_with_prefix)) != $delete_params_with_prefix)]">
			<xsl:value-of select="@name"/>
			<xsl:value-of select="'='"/>
			<xsl:value-of select="@value"/>
			<xsl:value-of select="'&amp;'"/>
		</xsl:for-each>
		<xsl:value-of select="$param_name"/>
		<xsl:value-of select="'='"/>
		<xsl:value-of select="$param_value"/>
	</xsl:template>
	<xsl:template name="url_delete_param">
		<xsl:param name="param_name"/>
		<xsl:value-of select="$prefix"/>
		<xsl:value-of select="$request/@folders"/>
		<xsl:value-of select="'/'"/>
		<xsl:for-each select="$gparams[@name != $param_name]">
			<xsl:choose>
				<xsl:when test="position() = 1">?</xsl:when>
				<xsl:otherwise>&amp;</xsl:otherwise>
			</xsl:choose>
			<xsl:value-of select="@name"/>
			<xsl:value-of select="'='"/>
			<xsl:value-of select="@value"/>
		</xsl:for-each>
	</xsl:template>
</xsl:stylesheet>
